package com.itheima.edu.info.subwaymanager.service;

import com.itheima.edu.info.subwaymanager.dao.SubwayDaoImpl;
import com.itheima.edu.info.subwaymanager.domain.Subway;

import java.util.ArrayList;


/**
 * @Author 王加鑫
 * @Date 2021/5/23 19:45
 * @Version 1.0
 */
public class SubwayServiceImpl implements SubwayService {

    private SubwayDaoImpl subwayDao = new SubwayDaoImpl();

    @Override
    public ArrayList<Subway> selectSubway() {
        return subwayDao.selectSubway();
    }

    @Override
    public void addSubway(Subway subway) {
        subwayDao.addSubway(subway);

    }

    @Override
    public void updateSubway() {

    }

    @Override
    public void deleteSubway() {

    }

    @Override
    public boolean isExists(String id) {
        int index = subwayDao.getIndex(id);
        return index == -1 ? false : true;
    }


}
